<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <title></title>
    <link rel="stylesheet" type="text/css" href="/tp/Public/css/bootstrap.min.css"/>
    <link rel="stylesheet" type="text/css" href="/tp/Public/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="/tp/Public/css/style.css"/>
</head>

<body>
<div id="container">
    <!---->

    <include file="Public/tpl/header.html" />

    <!---->

    <div id="main" class="container">
        <div class="row">
            <div class="col-md-8">

                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title"><b>对话</b></h3>
                    </div>
                    <div class="panel-body">
                        <form action="{:U('Message/add',array('id'=>$global_message['id']))}" method="post">
                            <textarea class="form-control" name="content"  rows="5" cols=""></textarea>
                            <input type="hidden" name="from_id" value="{$global_message['from_id']}"/>
                            <input type="hidden" name="to_id" value="{$global_message['to_id']}"/>
                            <br/>
                            <input class="btn btn-success pull-right" type="submit" name="" id="" value="回复" />
                        </form>
                    </div>
                    <!--本条消息可采用+ajax以提高用户体验-->
                    <div class="panel-body">
                        <div class="media-body alert alert-info">
                            <p class="dialog-message">千万注意!!!!!!!这是ajax消息</p>
                            <span class="pull-right">1 秒前</span>
                        </div>
                        <div class="media-right">
                            <img src="__PUBLIC__/images/{$global_message['self_avatar']}"/>
                        </div>
                    </div>
                    <hr/>
                    <foreach name="messages" item="message" key="key">
                        <if condition="($message['direction'] eq right)">
                            <div class="panel-body">
                                <div class="media-body alert alert-info">
                                    <p class="dialog-message">{$message['content']}</p>
                                    <span class="pull-right">{$message['create_time']}</span>
                                </div>
                                <div class="media-right">
                                    <img src="__PUBLIC__/images/{$message['to_avatar']}"/>
                                </div>
                            </div>
                        <else/>
                            <div class="panel-body">
                                <div class="media-left">
                                    <img src="__PUBLIC__/images/{$message['other_avatar']}"/>
                                </div>
                                <div class="media-body alert alert-info">
                                    <p class="dialog-message">{$message['content']}</p>
                                    <span class="pull-right">{$message['create_time']}</span>
                                </div>
                            </div>
                        </if>

                    </foreach>


                </div>

            </div>

            <div class="col-md-4 hidden-xs">



            </div>
        </div>

    </div>

    <!---->
</div>
<!---->

<include file="Public/tpl/footer.html" />
<!---->
<script src="/tp/Public/js/jquery-1.11.0.js" type="text/javascript" charset="utf-8"></script>
<script src="/tp/Public/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
</body>

</html>